package com.service;

import com.dto.BaseDto;
import com.entity.Comment;
import com.page.PageInfo;

import java.sql.SQLException;

public interface CommentService {
    /**
     *
     * @param pid 父id 常量的类别id
     * @return
     * @throws SQLException
     * @throws ClassNotFoundException
     */
    public BaseDto getCommentByPid(int pid, String cacheId) throws SQLException, ClassNotFoundException;


    /**
     * 增加一个常量
     *
     * @param comment
     *            常量对象
     * @return 返回插入的状态值 数字 为1成功 0失败 -值异常
     * @throws IllegalAccessException
     * @throws IllegalArgumentException
     * @throws SQLException
     *             抛出sql异常
     */
    public BaseDto addComment(Comment comment) throws IllegalArgumentException, IllegalAccessException, SQLException;

    /**
     * 修改常量信息
     * @param comment
     * @return
     * @throws IllegalArgumentException
     * @throws IllegalAccessException
     * @throws SQLException
     */
    public BaseDto updateComment(Comment comment) throws IllegalArgumentException, IllegalAccessException, SQLException;

    /**
     * 根据主键删除
     * @param coid
     * @return
     * @throws IllegalArgumentException
     * @throws IllegalAccessException
     * @throws SQLException
     */
    public BaseDto deleteComment(int coid) throws IllegalArgumentException, IllegalAccessException, SQLException;
    /**
     * 根据常量分类 分页查询，分页查询 就是 mysql的limit 语句需要2个参数 参数1从几开始取 参数2 取多长
     * @param pageInfo
     * @return
     * @throws Exception
     */
    public BaseDto queryCommentsByPage(PageInfo pageInfo, int pid) throws Exception;
}
